package cn.csxw.openchina.ui.activity;

import android.content.Intent;
import android.graphics.Color;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import cn.csxw.openchina.R;
import cn.csxw.openchina.base.BaseActivity;
import cn.csxw.openchina.base.BaseContentPagerAdapter;
import cn.csxw.openchina.base.BaseRefreshFragment;
import cn.csxw.openchina.ui.fragment.myFragment.MyFollowFansFragment;
import cn.csxw.openchina.ui.fragment.myFragment.MyFollowFragment;

/**
 * Created by User on 2017/1/17.
 */
public class MyFollowFansActivity extends BaseActivity {
    List<BaseRefreshFragment> mFragments = new ArrayList<>();
    String[] title = {"粉丝", "关注"};
    @BindView(R.id.tableLayout)
    TabLayout mTableLayout;
    @BindView(R.id.viewPager)
    ViewPager mViewPager;
    private BaseContentPagerAdapter mAdapter;
    @Override
    public int getLayoutRes() {
        return R.layout.activity_exercise;
    }

    @Override
    public void initView() {
        //关注Fragment中的粉丝
        mFragments.add(new MyFollowFansFragment());
        //关注Fragment中的关注
        mFragments.add(new MyFollowFragment());

        if (mAdapter == null) {
            mAdapter = new BaseContentPagerAdapter(getSupportFragmentManager());
            mViewPager.setAdapter(mAdapter);
            mTableLayout.setTabTextColors(R.color.spinner_background_press, Color.GREEN);
            mTableLayout.setupWithViewPager(mViewPager);
            Intent intent = new Intent(this,MyFollowActivity.class);
            startActivity(intent);
            finish();
        }
    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {
            mAdapter.setSwipeList(mFragments,title);
    }

    @Override
    public void onClick(View v, int id) {

    }
}
